<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../common/jquery/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../common/bootstrap/bootstrap-4.4.0-dist/js/bootstrap.js"></script>
<link href="../css/basic_layout.css" rel="stylesheet" type="text/css">
<link href="../css/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/commonAll.js"></script>
<script type="text/javascript" src="../js/artDialog.js"></script>
<title>信息管理系统</title>
<style>
	.alt td{ background:black !important;}
</style>
</head>
<body>
	<form id="submitForm" name="submitForm" action="" method="post">
		<input type="hidden" name="allIDCheck" value="" id="allIDCheck"/>
		<input type="hidden" name="fangyuanEntity.fyXqName" value="" id="fyXqName"/>
		<div id="container">
			<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
					</div>
				</div>
			</div>
			<div class="ui_content">
				<div class="ui_tb">
					<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
						<thead>
							<tr>
								<th>学生姓名</th>
								<th>学号</th>
								<th>手机号码</th>
								<th>邮箱</th>
								<th>未读消息</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="Tbody">
							<tr>
								<th>zht</th>
								<th>2016220203019</th>
								<th>2123</th>
								<th>xxx@qq.com</th>
								<th><a href='./ChuqiInfo'>编辑</a> <a href=''>删除</a></th>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</form>
</body>
<script type="text/javascript">

$(document).ready(function(){
	$.ajax({
		url:"getallstudents",
		success:function(result){
			$("#Tbody").empty();
	        console.log(result);
	        for(var i=0;i<result.length;i++){
	        	var $trTemp = $("<tr></tr>");
	        	$trTemp.append("<th>"+ result[i].stu_name +"</th>");
	            $trTemp.append("<th>"+ result[i].stu_id +"</th>");
	            $trTemp.append("<th>"+ result[i].stu_phone +"</th>");
	            $trTemp.append("<th>"+ result[i].stu_mail +"</th>");
	            $trTemp.append("<th>"+ result[i].count +"</th>");
	            $trTemp.append("<th>"+ "<a href='#' onclick='chat(this);return false;'>交流</a>"+"</th>");
	            $trTemp.appendTo("#Tbody");
        	}
		},
		error: function(err){
			console.log(err);
		}
    });
})

function chat(curE){
	var tr = curE.parentNode.parentNode;
	var children = tr.childNodes;
	sessionStorage.setItem("action", "chat");
	sessionStorage.setItem("stu_id", children[1].innerText);
	window.location.href = "./CommunicationInfo";
}
</script>
</html>
